package com.kapcb.mvc.controller;

import com.kapcb.common.result.ResultMessage;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * <a>Title: HeartbeatController </a>
 * <a>Author: Kapcb <a>
 * <a>Description: 健康检查心跳接口 <a>
 *
 * @author Kapcb
 * @version 1.0
 * @date 2024/7/7 16:36
 * @since 1.0
 */
@RestController
@RequestMapping("/actuator/health")
public class HeartbeatController {

    @GetMapping("/heartbeat")
    public ResultMessage<String> heartbeat() {
        return ResultMessage.success("success heartbeat, " + new Date());
    }

    @GetMapping("/liveness")
    public ResultMessage<String> liveness() {
        return ResultMessage.success("success liveness, " + new Date());
    }

    @GetMapping("/readiness")
    public ResultMessage<String> readiness() {
        return ResultMessage.success("success readiness, " + new Date());
    }

}
